from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time

driver_path=r"F:\demos\chromedriver_win32\chromedriver.exe"
driver=webdriver.Chrome(executable_path=driver_path)
driver.get('https://www.baidu.com/')

driver.execute_script("window.open('https://www.douban.com/')")
print(driver.current_url)
print(driver.window_handles)
driver.switch_to_window(driver.window_handles[1])
#得到豆瓣
print(driver.current_url)
